package com.wanmait.recycle.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.wanmait.recycle.mapper.FirsttypeMapper;
import com.wanmait.recycle.pojo.Firsttype;
import com.wanmait.recycle.service.FirsttypeService;
import com.wanmait.recycle.util.Pager;

@Service
@Transactional
public class FirsttypeServiceImpl implements FirsttypeService {

	@Resource
	private FirsttypeMapper firsttypeMapper;
	
	@Override
	public void insert(Firsttype object) {
		Integer maxId = firsttypeMapper.getMaxId();
		object.setSortCount(maxId==null?1:maxId+1); 
		firsttypeMapper.insert(object);
		
	}

	@Override
	public void update(Firsttype object) {
		// TODO Auto-generated method stub
		firsttypeMapper.update(object);
	}
	
	@Override
	public void delete(Integer id) {
		// TODO Auto-generated method stub
		firsttypeMapper.deleteById(id);
	}

	@Override
	public void delete(String ids) {
		// TODO Auto-generated method stub
		firsttypeMapper.deleteIds(null);
	}

	@Override
	public Firsttype findById(Integer id) {
		// TODO Auto-generated method stub
		
		return firsttypeMapper.findById(id);
	}
	
	
	@Override

	public List<Firsttype> findAll1() {
		// TODO Auto-generated method stub
		return firsttypeMapper.FindAll1();
	}


	@Override
	@Cacheable(value="recycle",key="'firsttype'")
	public List<Firsttype> findAll() {
		// TODO Auto-generated method stub
		return firsttypeMapper.FindAll();
	}

	@Override
	public int getDataCount() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<Firsttype> findAll(Pager pager) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Firsttype> findAll(Firsttype object) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int getDataCount(Firsttype object) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<Firsttype> findAll(Pager pager, Firsttype object) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void insertById(Integer id) {
		// TODO Auto-generated method stub
		firsttypeMapper.insertById(id);
	}

	@Override
	public void changeSortCount(Integer id, Integer tcount) {
		firsttypeMapper.changeSortCount(id,tcount);
		
	}

}
